<%@page contentType="text/javascript" pageEncoding="utf-8"%>
$(function(){
    var aiframe = document.createElement("iframe");
    var updateSize = function(){
        var iframe_height = 0;
        if($.browser.msie){
            iframe_height = document.body.scrollHeight;
        }else{
            $("body").children(":visible").each(function(){
                if($(this).css("position")!="absolute"){
                    iframe_height+=$(this).height();
                }
            });
        }
        aiframe.src = "<%="http://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() %>/portaljs.do?method=autoHeight&panelId=<%=request.getParameter("panelId")%>&iframe_height="+iframe_height;
    }
    updateSize();
    aiframe.style.display = "none";
    document.body.appendChild(aiframe);
    $(window).resize(function(){
    	setTimeout(updateSize, 300);
    });
});